<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="<%=basePath%>static/css/sidebar_css.css" rel="stylesheet" />
<link href="<%=basePath %>static/css/center.css" rel="stylesheet" />
<link href="<%=basePath %>static/css/common.css" rel="stylesheet" />
<link rel="stylesheet" href="<%=basePath%>static/css/jquery-ui.min.css" />
<link rel="stylesheet" href="<%=basePath%>static/css/jquery-ui-timepicker-addon.min.css" />
<link href="<%=basePath%>bootstrap/bootstrap.min.css" rel="stylesheet" />
<script type="text/javascript"
	src="<%=basePath%>static/js/jquery-1.11.1.min.js"></script>
<script type="text/javascript"
	src="<%=basePath%>bootstrap/bootstrap.min.js"></script>
<script type="text/javascript" 
	src="<%=basePath%>static/js/jquery-ui.min.js"></script>
<script type="text/javascript"
	src="<%=basePath%>static/js/jquery-ui-timepicker-addon.min.js"></script>
<title>Insert title here</title>
<script type="text/javascript">
function editSubmit(){
	var accountNo = $("#accountNo").val();
	var newAccountNo = $("#newAccountNo").val();
	if(newAccountNo==null) {
		alert("充值金额不能为空");
		return false;
	}
	$.ajax({
		url:"<%=basePath%>users/editAccountNo",
		type:"post",
		data:{accountNo:accountNo,newAccountNo:newAccountNo},
		success:function(result) {
			if (result==1) {
				alert("账户充值成功");
				$("#accountNo").val("");
			 	$("#newAccountNo").val("");
			} else {
				alert("账户充值失败");
			}
		},
		error:function() {
			alert("程序出错");
		}
	});
}
</script>
</head>
<body>
<h4 style="text-align: center; font-family: 楷体; font-weight: bold;">账户金额充值</h4>
<div class="container">
	<div class="lay-bd">
		<div class="row">
			<div class="panel panel-default">
  				<div class="panel-heading">	
  					<div class="panel panel-info">
						<div class="panel-heading">当前账户金额为：</div>
						<div class="panel-body">							   
							<div class="form-group">
								<input id="accountNo" name="accountNo"
											class="form-control" maxlength="25" type="text" value="${user.accountNo }元" disabled="disabled">
			  				</div>
						</div>
					</div>
					<div class="panel panel-info">
						<div class="panel-heading">添加金额(元)：</div>
						<div class="panel-body">							   
							<div class="form-group">
								<input id="newAccountNo" name="newAccountNo"
											class="form-control" maxlength="25" type="text" value="" placeholder="请输入要添加的金额数量...">
			  				</div>
						</div>
					</div>					
					<div>
<!-- 					<a href="javascript:cancelSubmit();"  onclick="cancelSubmit();" role="button" class="btn btn-info" style="margin-left: 350px;">取消</a>
 -->					<a href="javascript:void(0);"  onclick="editSubmit();" role="button" class="btn btn-info" style="margin-left: 350px; ">确认添加</a>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
</body>
</html>